<?php
include 'cabecalhoAdm.php';
$metodo = "";
if (isset($_GET['comando']) && $_GET['comando'] == "update") {
    $metodo = "atualizar";       
    $id = $_GET['id'];
    $endereco = "<form class='form-admin' action='admin_ad_autor.php?atualizar=salvar&id=$id' method='POST'>";
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if(isset($_GET['atualizar'])){
        $metodo = "update";        
    }else{
        $metodo = "cadastro";
    }   
}
require_once '../../Controller/Controller.Autor.php';
?>

<a href="admin_autor.php">Voltar</a>
<div class="containers">
    <h1>Adicionar Autor</h1>
    <form class="form-admin" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
        <label>Nome:</label><input type="text" name="nome" value="<?php if(isset($nome)) echo $nome; ?>"/><br>
        <label>Descrição:</label><input type="text" name="descricao" value="<?php if(isset($descricao)) echo $descricao; ?>"/><br>
        <label>Foto:</label><input type="File" name="foto"/><br>                                        
        </div>
        <input type="SUBMIT" value="Salvar" class="bt_buscar"/>
        <?php if (isset($erro)) {
            echo $erro;
        } elseif (isset($msg)) {
            echo $msg;
        } ?>
    </form>
</div>
<div id="rodape">		
</div>
</div>
</body>

</html>